package com.xiangxiao.rpan.settings.enums;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.Getter;

/**
 * @auther xiangxiao
 * @email 573768011@qq.com
 * @data 2024/1/9 15:22
 */
@Getter
public enum ReadmeDisplayModeEnum {
  /**
   * 顶部显示
   */
  TOP("top"),

  /**
   * 底部显示
   */
  BOTTOM("bottom"),

  /**
   * 弹窗显示
   */
  DIALOG("dialog");

  private String value;

  @JsonValue
  public String getReadmeDisplayModeEnum() {
    return this.value.toUpperCase();
  }

  @JsonCreator
  public static ReadmeDisplayModeEnum fromString(String type) {
    return type == null
        ? null
        : ReadmeDisplayModeEnum.valueOf(type.toUpperCase());
  }

  ReadmeDisplayModeEnum(String val) {
    this.value = val.toUpperCase();
  }
}

